package com.wltjack.sysmanage.config;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @ClassName AppConfig
 * @Description 应用配置类
 * @Author kangliang
 * @Date 2021/03/15 14:44
 * @Version 1.0
 */
@Configuration
public class AppConfig {

    @Resource
    private RestTemplateBuilder restTemplateBuilder;

    /**
     * 功能描述: 创建restTemplate Bean
     *
     * @return: RestTemplate
     * @Author: kangliang
     * @Date: 2021-03-15 14:44
     */
    @Bean
    public RestTemplate restTemplate() {
        return restTemplateBuilder.build();
    }

    @Bean
    public ObjectMapper objectMapper() {
        return new ObjectMapper();
    }
}
